home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_498 / zoomdaemon / source / zoom-daemon.h next >
C/C++ Source or Header  |  1992-05-06  |  3KB  |  110 lines

  1. #define COPYRIGHT   "Copyright 1989 by Davide P. Cervone, all rights reserved" 
  2.  
  3. #define PORTNAME        "Zoom-Daemon-Port"
  4.  
  5.  
  6. /*
  7.  *  Zoom Gadget GadgetID
  8.  */
  9.  
  10. #define ZOOMGADG        (('Z'<<8)|('M'))
  11.  
  12. /*
  13.  *  Zoom Gadget sizes
  14.  */
  15.  
  16. #define ZOOMWIDTH       27
  17. #define ZOOMHEIGHT      10
  18. #define ZOOMDEPTH       2
  19. #define ZOOMWORDS       2
  20.  
  21. #define LRZOOMWIDTH     19
  22. #define LRZOOMHEIGHT    10
  23. #define LRZOOMDEPTH     2
  24. #define LRZOOMWORDS     2
  25.  
  26.  
  27. /*
  28.  *  Used to define flag bits
  29.  */
  30.  
  31. #define     BIT(x)      (1<<(x))
  32.  
  33. /*
  34.  *  Extended gadget structure:
  35.  *     pointers for linked list og Zoom Gadgets
  36.  *     pointer to window that has this zoom gadget
  37.  *     window's un-zoomed size
  38.  *     flags for this window/gadget
  39.  *     copy of the ZoomGadget used by this window
  40.  */
  41.  
  42. struct ExtGadget
  43. {
  44.    struct ExtGadget *Next,*Prev;
  45.    struct Window *Window;
  46.    WORD x,y,w,h;
  47.    UWORD Flags;
  48.       #define EG_ZOOMEDOUT  BIT(0)
  49.       #define EG_ZOOMEDIN   BIT(1)
  50.       #define EG_ZOOMED     (EG_ZOOMEDOUT|EG_ZOOMEDIN)
  51.    struct Gadget Gadget;
  52. };
  53. #define EXTGADGETSIZE   (sizeof(struct ExtGadget))
  54.  
  55.  
  56. /*
  57.  *  Zoom_HandlerInfo
  58.  *
  59.  *  The data structure shared between the handler and the loader
  60.  *  the loader sets some of these variables on behalf of the handler,
  61.  *  in order to keep the handler as small as possible.  The handler
  62.  *  passes information that the loader needs (like the pointers to 
  63.  *  the routines for SetFunction) via this structure
  64.  */
  65.  
  66. struct Zoom_HandlerInfo
  67. {
  68.    struct MsgPort Zoom_Port;                /* port used to store this info */
  69.    short MajVers,MinVers, MinLoadVers;      /* version of handler and loader */
  70.    long Segment;                            /* SegList loaded by loader */
  71.    struct IntuitionBase **IntuitionBase;
  72.    struct SysBase **SysBase;
  73.    
  74.    /*
  75.     *  This is the Interrupt structure used to add the handler into the
  76.     *  Input Device chain of handlers
  77.     */
  78.  
  79.    struct Interrupt *Zoom_Interrupt;
  80.  
  81.    /*
  82.     *  These are the routines replaced by SetFunction()
  83.     */
  84.    
  85.    void (*aOpenWindow)();
  86.    void (*aCloseWindow)();
  87.    void (*aAddGadget)();
  88.    void (*aAddGList)();
  89.    
  90.    long *OldOpenWindow;
  91.    long *OldCloseWindow;
  92.    long *OldAddGadget;
  93.    long *OldAddGList;
  94.    
  95.    /*
  96.     *  These are the structures used by Zoom-Handler for set-up and clean-up
  97.     */
  98.     
  99.    void (*SetupWindow)();
  100.    struct ExtGadget **FirstZoom;
  101. };
  102.  
  103.  
  104. /*
  105.  *  Macros to make using Zoom_HandlerInfo easy
  106.  */
  107.  
  108. #define VAR(x)      (*(Zoom_HandlerData->x))
  109. #define var(x)      (Zoom_HandlerData->x)
  110.